/**
 * Copyright(c) Hainan eKing Technology co., LTD
 *
 * @date 2013年8月13日
 * 	
 * Original Author: 郑兴(zhengxing)
 *
 * ChangeLog
 *
 */
package com.hnas.sys.service.upload.mapper;

import org.springframework.beans.BeanUtils;

import com.hnas.core.mapper.Mapper;
import com.hnas.sys.orm.Attachment;
import com.hnas.sys.service.upload.dto.DTOAttachment;

/**
 * @author 郑兴(zhengxing)
 *
 */
public class AttachmentMapper extends Mapper<DTOAttachment, Attachment> {
	private static AttachmentMapper attachmentMapper;
	
	private AttachmentMapper() {
		super(DTOAttachment.class, Attachment.class);
	}
	
	public static AttachmentMapper getInstance() {
		if (attachmentMapper == null) {
			attachmentMapper = new AttachmentMapper();
		}
		return attachmentMapper;
	}
	

	public DTOAttachment mapToValue(Attachment entity) {
		DTOAttachment value = new DTOAttachment();//super.mapToValue(entity);
		BeanUtils.copyProperties(entity, value, new String[]{"users","authorityResources"});
		return value;
	}
}
